<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
        <input type="text" v-model="nr" @keyup.enter="queryGet">
    <form style="width: 200px;">
        <fieldset>
            <legend>信息显示表单</legend>
            <ul>
                <li v-for="(item,index) in list">
                    {{ item.pname }}
                    {{ item.id }}
                </li>
            </ul>
        </fieldset>
    </form>
    </div>

    <script src="https://unpkg.com/axios/dist/axios.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/vue@2.6.14/dist/vue.js"></script>
    <script>
        let app=new Vue({
            el:"#app",
            data:{
                nr:"",
                list:[]
            },
            methods:{
                queryGet(){
                    this.list=""
                    axios
                        .get(`http://localhost:8080/queryGoods`)
                        .then(res => {
                            console.log(res);
                            this.list=res.data.data;
                        })
                    }
            }
        });
        app.queryGet();
    </script>
</body>
</html>